<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>赛博朋克俄罗斯方块</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
        
        body {
            font-family: 'Orbitron', sans-serif;
            text-align: center;
            background: linear-gradient(135deg, #0a0a2a 0%, #1a1a3a 100%);
            position: relative;
            color: #00f7ff;
            overflow: hidden;
            height: 100vh;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        
        body::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                linear-gradient(rgba(0, 247, 255, 0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(148, 0, 255, 0.05) 1px, transparent 1px);
            background-size: 30px 30px;
            z-index: -1;
            animation: gridPulse 8s infinite alternate;
        }

        @keyframes gridPulse {
            0% { opacity: 0.3; }
            100% { opacity: 0.7; }
        }

        @keyframes levelUp {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
            50% { opacity: 1; transform: translate(-50%, -100%) scale(1.2); }
            100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
        }

        @keyframes scorePop {
            0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
            50% { transform: translate(-50%, -100%) scale(1.2); opacity: 1; }
            100% { transform: translate(-50%, -150%) scale(1); opacity: 0; }
        }

        h1 {
            font-size: 2.5rem;
            text-transform: uppercase;
            letter-spacing: 3px;
            margin: 20px 0 30px;
            color: #00f7ff;
            text-shadow: 0 0 10px #00f7ff, 
                         0 0 20px #00f7ff,
                         0 0 30px #9400ff;
            animation: textGlow 2s infinite alternate;
        }

        @keyframes textGlow {
            0% { text-shadow: 0 0 10px #00f7ff, 0 0 20px #00f7ff; }
            100% { text-shadow: 0 0 15px #00f7ff, 0 0 30px #9400ff, 0 0 45px #ff00a0; }
        }

        #controls {
            margin: 30px 0;
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }
        
        #controls button {
            padding: 10px 20px;
            font-size: 16px;
            font-weight: bold;
            background: rgba(0, 0, 0, 0.3);
            color: #00f7ff;
            border: 2px solid #00f7ff;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
            letter-spacing: 1px;
            text-transform: uppercase;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.5),
                       inset 0 0 5px rgba(0, 247, 255, 0.2);
        }

        #controls button:hover {
            background: rgba(0, 247, 255, 0.2);
            box-shadow: 0 0 20px #00f7ff,
                       inset 0 0 10px rgba(0, 247, 255, 0.3);
            transform: translateY(-3px);
        }

        #controls button:disabled {
            color: #555;
            border-color: #555;
            box-shadow: none;
            background: rgba(30, 30, 30, 0.3);
            cursor: not-allowed;
        }

        #fullscreen-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 100;
            background: rgba(20, 0, 40, 0.7);
            border-color: #9400ff;
            box-shadow: 0 0 15px rgba(148, 0, 255, 0.5);
        }

        #fullscreen-btn:hover {
            border-color: #ff00a0;
            box-shadow: 0 0 25px rgba(255, 0, 160, 0.7);
        }

        #game-container {
            display: flex;
            gap: 20px;
            margin: 0 auto;
            padding: 20px;
            border: 3px solid #9400ff;
            box-shadow: 0 0 30px rgba(148, 0, 255, 0.7),
                        inset 0 0 15px rgba(0, 247, 255, 0.5);
            background-color: rgba(10, 10, 40, 0.7);
            width: fit-content;
            border-radius: 5px;
            transform-origin: center center;
        }

        #game-board {
            border: 2px solid #00f7ff;
            background-color: rgba(0, 0, 20, 0.8);
            box-shadow: inset 0 0 10px rgba(0, 247, 255, 0.3);
        }

        #side-panel {
            display: flex;
            flex-direction: column;
            gap: 15px;
            min-width: 120px;
            justify-content: space-between;
        }

        .panel {
            background: rgba(20, 0, 40, 0.6);
            border: 1px solid #9400ff;
            box-shadow: 0 0 10px rgba(148, 0, 255, 0.5),
                       inset 0 0 5px rgba(0, 247, 255, 0.3);
            color: #00f7ff;
            padding: 12px;
            border-radius: 5px;
        }

        .panel h3 {
            text-shadow: 0 0 5px #00f7ff;
            margin: 0 0 5px 0;
            font-size: 14px;
        }
        
        .panel p {
            margin: 0;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 0 0 5px #00f7ff;
        }

        #next-piece {
            margin-top: 5px;
            background-color: #111;
        }

        #game-start-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(10, 5, 30, 0.95);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10;
        }
        
        #game-start-overlay h2 {
            font-size: 3rem;
            margin-bottom: 30px;
            color: #ff00a0;
            text-shadow: 0 0 10px #ff00a0,
                         0 0 20px #ff00a0,
                         0 0 30px #9400ff;
            letter-spacing: 3px;
            animation: textGlow 2s infinite alternate;
        }
        
        #game-start-overlay p {
            font-size: 1.5rem;
            margin-bottom: 30px;
            color: #00f7ff;
            text-shadow: 0 0 10px rgba(0, 247, 255, 0.7);
        }
        
        #game-start-overlay button {
            padding: 15px 40px;
            font-size: 1.2rem;
            background: rgba(148, 0, 255, 0.2);
            color: #ff00a0;
            border: 2px solid #ff00a0;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
            letter-spacing: 2px;
            text-transform: uppercase;
            box-shadow: 0 0 15px rgba(255, 0, 160, 0.5),
                       inset 0 0 10px rgba(148, 0, 255, 0.3);
        }

        #game-start-overlay button:hover {
            background: rgba(255, 0, 160, 0.3);
            box-shadow: 0 0 30px rgba(255, 0, 160, 0.7),
                       inset 0 0 15px rgba(148, 0, 255, 0.4);
            transform: translateY(-5px);
        }

        /* 响应式调整 */
        @media (max-width: 600px) {
            #game-container {
                flex-direction: column;
                padding: 15px;
            }
            
            #side-panel {
                flex-direction: row;
                min-width: auto;
                margin-top: 15px;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            #game-start-overlay h2 {
                font-size: 2rem;
            }
        }

        #effects-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 5;
        }

        .score-effect {
            animation: scorePop 1s forwards;
        }

        @media (max-height: 500px) {
            #game-container {
                transform: scale(0.8);
            }
        }

        @media (max-height: 400px) {
            #game-container {
                transform: scale(0.6);
            }
        }
    </style>
</head>
<body>
    <h1>赛博朋克俄罗斯方块</h1>
    <div id="controls">
        <button id="start-btn">开始游戏</button>
        <button id="pause-btn" disabled>暂停</button>
        <button id="reset-btn" disabled>重新开始</button>
        <button id="fullscreen-btn">全屏</button>
    </div>
    <div id="game-start-overlay">
        <h2>赛博朋克俄罗斯方块</h2>
        <button onclick="startGame()">开始游戏</button>
    </div>
    <div id="game-container" style="display: none;">
        <canvas id="game-board" width="200" height="400"></canvas>
        <div id="side-panel">
            <div class="panel">
                <h3>下一个方块</h3>
                <canvas id="next-piece" width="80" height="80"></canvas>
            </div>
            <div class="panel">
                <h3>分数</h3>
                <p id="score">0</p>
            </div>
            <div class="panel">
                <h3>级别</h3>
                <p id="level">1</p>
            </div>
        </div>
    </div>
    <div id="effects-layer"></div>
    
    <!-- 音效 -->
    <audio id="move-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-arcade-game-jump-coin-216.mp3"></audio>
    <audio id="rotate-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-quick-jump-arcade-game-239.mp3"></audio>
    <audio id="clear-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-unlock-game-notification-253.mp3"></audio>
    <audio id="gameover-sound" src="https://assets.mixkit.co/sfx/preview/mixkit-retro-arcade-lose-2027.mp3"></audio>
    
    <script src="tetris.js"></script>
</body>
</html>